﻿/// <reference path="g.js" />
$.fn.extend({
    //员工
    employee: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/Employee",
            binder: { text: "EmployeeName", value: "EmployeeId" },
            itemEvent:itemEvent
        })
    },
    //客户等级
    customerLevel: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/CustomerLevel",
            binder: { text: "CustomerLevelName", value: "CustomerLevelId" },
            itemEvent: itemEvent
        });
    },
    //客户
    customer: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/Customer",
            binder: { text: "CustomerName", value: "CustomerId" },
            itemEvent: itemEvent
        });
    },
    //供应商
    provider: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/Provider",
            binder: { text: "CompanyName", value: "ProviderId" },
            itemEvent: itemEvent
        });
    },
    //仓库
    store: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/Store",
            binder: { text: "StoreName", value: "StoreId" },
            itemEvent: itemEvent
        });
    },
    //商品类别
    category: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/Category",
            binder: { text: "CategoryName", value: "CategoryId" },
            itemEvent: itemEvent
        });
    },
    //品牌
    brand: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/Brand",
            binder: { text: "BrandName", value: "BrandName" },
            itemEvent:itemEvent
        });
    },
    //支付方式
    paymentType: function (itemEvent) {
        $(this).commonbox({
            url: "/Common/PaymentType",
            binder: { text: "PaymentTypeName", value: "PaymentTypeId" },
            itemEvent: itemEvent
        });
    },
    //包装单位（瓶，盒，箱）
    unit: function () {
        $(this).commonbox({
            data: [{"text":"箱","value":"箱"},{"text":"盒","value":"盒"},{"text":"瓶","value":"瓶"}],
            binder: { text: "text", value: "value" }
        });
    },
    //保质期单位
    shelfLifeUnit: function (itemEvent) {
        $(this).commonbox({
            data: [{ "text": "年", "value": "1" }, { "text": "月", "value": "2" }, { "text": "日", "value": "3" }],
            binder: { text: "text", value: "value" },
            itemEvent: itemEvent
        });
    },
    //企业类别
    companyType: function (itemEvent) {
        $(this).commonbox({
            data: [{ "text": "生产", "value": "1" },{ "text": "批发", "value": "2" }, { "text": "零售", "value": "3" }, ],
            binder: { text: "text", value: "value" },
            itemEvent: itemEvent
        });
    }

});
